<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/home/include/init_home.jsp" %>
<%@ page import="com.qbooks.board.*" %>
<%
	String board_id			= StringUtil.nvl(request.getParameter("board_id"), "1");
	String search_col		= StringUtil.nvl(request.getParameter("search_col"), "subject");
	String search_word		= StringUtil.nvl(request.getParameter("search_word"));
	String curr_page 		= StringUtil.nvl(request.getParameter("curr_page"), "1");

	String search_url		= "./wordList.jsp?board_id="+board_id+"&search_col="+search_col+"&search_word="+search_word;

	BoardDAO boardDAO 		= new BoardDAO();
	
	HashMap infos = new HashMap();
	infos.put("board_id",		board_id);
	
	HashList boardInfo		= boardDAO.selectBoardInfo(infos);

	infos.put("search_col",		search_col);
	infos.put("search_word",	search_word);
	infos.put("curr_page",		curr_page);
	infos.put("line_per_page",	boardInfo.get("line_per_page",0));
	
	HashList wordList 		= boardDAO.selectWordList(infos);
	
	//쓰기권한
	boolean bWritable		= true;
	if ("A".equals(boardInfo.get("write_auth",0))) {	//관리자
		bWritable = isAdmin;
	} else if ("M".equals(boardInfo.get("write_auth",0))) {	//회원
		bWritable = isLogin;
	}

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
	<title><%= HOME_NAME %></title>
	<%@ include file="/home/include/cssnjs.jsp"  %>
	<script type="text/javascript">
	$(document).ready(function() {
		$('.pressed').mouseover(function() {
			var src = $(this).attr('src');
			$(this).attr('src', src.replace('.png', '_pressed.png'));
		}).mouseout(function() {
			var src = $(this).attr('src');
			$(this).attr('src', src.replace('_pressed', ''));
		});
	});
	
	</script>
</head>
<body>
	<div id="wrap">
		<%@ include file="/home/include/header.jsp"  %>

		<div id="contents">
			<h2>공지사항</h2>
            <ul id="contents_list">
	<%      for (int i = 0; i < wordList.size(); i++) {		%>
            	<a href="./noticeView.jsp?word_id=<%=wordList.get("word_id",i) %>&board_id=<%=board_id %>&search_col=<%=search_col%>&search_word=<%=search_word%>&curr_page=<%=curr_page%>">
	            	<li class="board">
            			<h4><%= wordList.get("subject",i) %></h4>
		            	<p><%= wordList.get("init_date",i) %></p>
		            	<div class="detail">
	            			<img src="../home/images/icon_detail.png"/>
		            	</div>
            		</li>
	        	</a>
  	<%		} %>
            </ul>   
		</div>
		
		<%@ include file="/home/include/footer.jsp"  %>	
	</div>

</body>








</html>









